

#include "xlibrary_config.h"

#if LIBARARY_ALERT_ENABLE

#include <stdint.h>
#include <stdbool.h> 
#include <string.h>

//#include "FreeRTOS.h"
//#include "timers.h"
#include "os_timer.h"

#include "alert.h"

static bool         m_alert_timer_started = false; 
void* m_alert_timer = NULL; 

void alert_timer_start(void)
{
    if( !m_alert_timer_started )
    {
        m_alert_timer_started = true; 
        os_timer_start( &m_alert_timer );
    }
}
void alert_timer_stop(void)
{
    if( m_alert_timer_started )
    {
        m_alert_timer_started = false; 
        os_timer_stop( &m_alert_timer );
    }
}

void alert_timer_create(void)
{
    if( m_alert_timer == NULL ) 
    {
        os_timer_create( &m_alert_timer, "alert_timer", 0, ALERT_TIME_BASE, true, alert_on_timer_timeout_handler );
    }
}

#endif // !LIBARARY_ALERT_ENABLE
